package com.xiaoyu.base.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.xiaoyu.base.entity.ProvinceCityEntity;

import java.util.List;

import static androidx.room.OnConflictStrategy.REPLACE;

@Dao
public interface ProvinceCityDao {

    @Insert(onConflict = REPLACE)
    void upsert(ProvinceCityEntity entity);

    @Insert(onConflict = REPLACE)
    void upsertAll(List<ProvinceCityEntity> entityList);

    @Query("SELECT * FROM province_city_table ORDER BY ROWID ASC")
    List<ProvinceCityEntity> getProvinceCityList();
}
